package com.study.bean.myabtisplis;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@Accessors(chain = true)
public class User {

    //@TableId(type = IdType.ID_WORKER)//生成19位的Long 数字类型
    //@TableId(type = IdType.ID_WORKER_STR)//生成19位的Long
    @TableId(type = IdType.ASSIGN_ID)//生成19位的Long
    private Long id;
    private String name;
    private Integer age;
    private String email;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public Long id() {
        return id;
    }

    public String name() {
        return name;
    }

    public String getNames() {
        return this.name;
    }

    public Long getIds(User user) {
        return this.id;
    }
}